package org.lc.design.samples.case1.store.impl;

import org.lc.design.samples.case1.store.ICarManufacturing;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* 轿车制造服务
* @author lc
* @date 2024/3/26
*/
public class SedanManufacturingService implements ICarManufacturing {

    private Logger logger = LoggerFactory.getLogger(SedanManufacturingService.class);

    @Override
    public void manufactureCar(String orderId, Integer orderNumber) {
        logger.info("订单ID：{}，订单数量：{}",orderId,orderNumber);
        logger.info("轿车制造中...");
        for(int i = 1;i <= orderNumber;i++) {
            try {
                logger.info("已制造轿车数量：{}，剩余制造数量：{}",i,orderNumber - i);
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        logger.info("订单完成。");
    }
}
